/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author PR
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';
import { UploadApiResult } from '../sys/upload';
import { UploadFileParams } from '/#/axios';

const { ctxPath, adminPath } = useGlobSetting();

export interface ViewWmsMomOrderdelApplyDel extends BasicModel<ViewWmsMomOrderdelApplyDel> {
  mocode?: string; // 生单单号
  mdeptcode?: string; // 部门编码
  mdeptname?: string; // 部门名称
  invcode?: string; // 存货编码
  cinvname?: string; // 存货名称
  cinvstd?: string; // 存货规格
  qty?: number; // 生产数
  qualifiedinqty?: number; // 入库数
  iqty?: number; // 申请入库数
  syqty?: number; // 剩余申请数
}

export const viewWmsMomOrderdelApplyDelList = (params?: ViewWmsMomOrderdelApplyDel | any) =>
  defHttp.get<ViewWmsMomOrderdelApplyDel>({ url: adminPath + '/mo/rd10/viewWmsMomOrderdelApplyDel/list', params });

export const viewWmsMomOrderdelApplyDelListData = (params?: ViewWmsMomOrderdelApplyDel | any) =>
  defHttp.post<Page<ViewWmsMomOrderdelApplyDel>>({ url: adminPath + '/mo/rd10/viewWmsMomOrderdelApplyDel/listData', params });

export const viewWmsMomOrderdelApplyDelForm = (params?: ViewWmsMomOrderdelApplyDel | any) =>
  defHttp.get<ViewWmsMomOrderdelApplyDel>({ url: adminPath + '/mo/rd10/viewWmsMomOrderdelApplyDel/form', params });

export const viewWmsMomOrderdelApplyDelSave = (params?: any, data?: ViewWmsMomOrderdelApplyDel | any) =>
  defHttp.postJson<ViewWmsMomOrderdelApplyDel>({ url: adminPath + '/mo/rd10/viewWmsMomOrderdelApplyDel/save', params, data });

export const viewWmsMomOrderdelApplyDelImportData = (
  params: UploadFileParams,
  onUploadProgress: (progressEvent: ProgressEvent) => void,
) =>
  defHttp.uploadFile<UploadApiResult>(
    {
      url: ctxPath + adminPath + '/mo/rd10/viewWmsMomOrderdelApplyDel/importData',
      onUploadProgress,
    },
    params,
  );

export const viewWmsMomOrderdelApplyDelDelete = (params?: ViewWmsMomOrderdelApplyDel | any) =>
  defHttp.get<ViewWmsMomOrderdelApplyDel>({ url: adminPath + '/mo/rd10/viewWmsMomOrderdelApplyDel/delete', params });
